package book.security;

import java.io.IOException;
import java.math.BigInteger;
import java.security.AlgorithmParameterGenerator;
import java.security.AlgorithmParameters;
import java.security.NoSuchAlgorithmException;

public class AlgorithmParameterGeneratorTest {

	public static void main(String[] args) throws IOException, NoSuchAlgorithmException {
		
		AlgorithmParameterGenerator gen = AlgorithmParameterGenerator.getInstance("DSA");
		gen.init(512); //不能随便指定一个值，这是一个特定的值512 - 1024, or 2048
		AlgorithmParameters params = gen.generateParameters();
		byte[] b = params.getEncoded();
		System.out.println(new BigInteger(b));
	}
}
